//
//  CallBack.h
//  FlashAnimation
//
//  Created by chiawei.tseng on 13/1/2.
//
//

#ifndef CallBack_H
#define CallBack_H

class CCallBack
{
public:
    
    typedef void(*CallbackFunctionPtr)(void*);
    
    CCallBack():m_CallbackFunction(0){}
    
    CCallBack(CallbackFunctionPtr callbackFunctionPtr):m_CallbackFunction(callbackFunctionPtr){}
    
    virtual ~CCallBack(){}
    
    virtual void invoke(void* data)
    {
        if(m_CallbackFunction)
        {
            m_CallbackFunction(data);
        }
    }
    
private:
    
    CallbackFunctionPtr m_CallbackFunction;
};

typedef CCallBack* CCallBackPtr;

#endif
